<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.roadmap.common.RdcResourceBundle" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="res/css/layout.css" rel="stylesheet" type="text/css" media="all" />
<link href="res/css/auth.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="res/js/func.js"></script>
<script type="text/javascript" src="res/js/auth.js"></script>
<title>注册第二步 | <%=RdcResourceBundle.COMPANY_NAME %></title>
</head>

<body onload="setDays();">
<div id="container">
	<jsp:include page="/res/jsp/header.jsp"></jsp:include>
	
	<!-- define the frame for loging on-->
	<div class="mainbody">
	<div class="signs-height">
	<div class="logonbody">
		<div class="logon-div">
		<div class="login-form">			
			<div class="title-div">注册第二步</div>
			<!-- define a form for logging in -->
			<html:form action="/signs" onsubmit="return checkRegInputs();">
				<div class="frame">	
				<div id="signsMessage" class="error-message"><html:errors /></div>
				<!-- define a form for registration -->
					<table class="login-table">
						<tr>
							<td class="left-column"></td>
							<td class="right-column">
								<html:hidden property="mailCodes" styleClass="input-text" value='<%=request.getParameter("mailcodes") %>'/>
							</td>
						</tr>
						<tr>
							<td class="left-column">密码:</td>
							<td class="right-column">
								<html:password property="password" styleClass="input-text" maxlength="16" tabindex="1" onfocus="promptPwd();" onblur="checkPassword();"/>
							</td>
							<td class="message-column"><span id="pwdMsg" class="prompt-message"><span></td>
						</tr>
						<tr>
							<td class="left-column">确认密码:</td>
							<td class="right-column">
								<html:password property="confirmPassword" styleClass="input-text" maxlength="16" tabindex="2" onfocus="promptRePwd();" 
												onblur="checkConfirmPassword();"/>
							</td>
							<td class="message-column"><span id="confPwdMsg" class="prompt-message"></span></td>
						</tr>
						<tr>
							<td class="left-column">真实姓名:</td>
							<td class="right-column">
								<html:text property="realName" styleClass="input-text" tabindex="3" maxlength="30" onfocus="promptUserName();" 
												onblur="checkRealName();"/>
							</td>
							<td class="message-column"><span id="nameMsg" class="prompt-message"></span></td>
						</tr>
						<tr>
							<td class="left-column">性别:</td>
							<td class="right-column">
							  <select class="select" id="sex" name="sex" tabindex="4">
							  <option value="f" selected>女</option>
							  <option value="m">男</option> 
							  </select> 
							</td>
						</tr>	
						<tr>
							<td class="left-column">生日:</td>
							<td class="right-column">
							 <select class="select" id="year" name="birthYear"  tabindex="5" onchange="setDays();" tabindex="5">
								<script>
									var curDate = new Date();
									var maxYear = curDate.getFullYear()-3;
									for(i=maxYear;i>=1920;i--)
										document.write("<option>"+i+"</option>")
								</script>
							 </select>
							 <select class="select" id="month" name="birthMonth"  tabindex="6" onchange="setDays();" tabindex="6">
							 	<script>for(i=1;i<=12;i++)document.write("<option>"+i+"</option>")</script>
							 </select>
							 <select class="select" id="day" name="birthDay"  tabindex="7"></select>
							</td>
						</tr>			
						<tr>
							<td class="left-column"></td>
							<td class="right-column"><html:submit property="signsSubmit" styleClass="submit-signup" value="完成注册" tabindex="8"/>
							</td>
						</tr>
					</table>
				</div>
			</html:form>	
		</div></div>
	</div></div>
	<div class="clear-div"></div>
	</div>
	
	<jsp:include page="/res/jsp/footer.jsp"></jsp:include>
</div>

<script type="text/javascript"> 
	
	
	function setDays(){ 
		var slYear=$("year");		
		var vYear=parseInt(slYear.options[slYear.selectedIndex].text);
		var slMonth=$("month");
		var vMonth=parseInt(slMonth.options[slMonth.selectedIndex].text);
		var nDay=new Date(vYear,vMonth,0);
		var max=nDay.getDate();
		var day=$("day");
		day.length=0;
		for(var i = 0;i<max; i++){
			day.options[day.length++].value=day.length;
			day.options[day.length-1].text=day.length;
		}
 	 }
 	 
 	 if(checkRegCodes()) {
 	 	$("password").focus();
 	 }
 
</script>
</body>

</html>
